/**
 * 
 */
package br.com.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Joelson
 *
 */
public class Formatar {
	
	Date data = new Date();
	// d = dia, M (maiusculo) = mes e y = ano (obs: m = minutos)
	SimpleDateFormat formatar = new SimpleDateFormat("dd/MM/yyyy");
	
	public void converterDataString(){
		 try {	            
	            //imprimir a data
	            System.out.println(formatar.format(data));
	 
	            //agora vamos converter a String para Date
	            String dataString = "01/01/1995";
	            
	            data = formatar.parse(dataString);
	 
	        } catch (Exception e) {
	            System.out.println(e.getMessage());
	        }
	}

}
